LOCAL_PATH := $(call my-dir)

#We need to save LOCAL_PATH since it is likely to be modified by the sub-modules.
SAVED_PATH := $(LOCAL_PATH)

#Building openal and libpng static libraries
#include $(call all-subdir-makefiles)


BASE_PATH := $(call my-dir)
BASE_PATH := $(SAVED_PATH)
##### Prebuilt library ####

include $(CLEAR_VARS)

# LOCAL_CFLAGS := -g

APP_OPTIM := debug

LOCAL_PATH := /cygdrive/c/Engine

LOCAL_MODULE    := Engine-prebuilt
LOCAL_SRC_FILES := lib/libEngine.a

#assimp includes
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libs/assimp/assimp

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/includes
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/includes/Engine2d
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/includes/Engine3d
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/includes/Math
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/includes/Menu
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/includes/libpng
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/includes/Other
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/includes/Shaders
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/lib/assimp/assimp

LOCAL_PATH				:= $(BASE_PATH)
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)

LOCAL_PATH	:= /cygdrive/c/Engine

LOCAL_EXPORT_LDLIBS := -llog -lGLESv1_CM -lGLESv2

include $(PREBUILT_STATIC_LIBRARY)

##including freetype //must have! add permission to libfreetype.a (chmod a+rwx)
include $(CLEAR_VARS)
LOCAL_MODULE := libfreetype
LOCAL_PATH	:= /cygdrive/c/Engine/lib
LOCAL_SRC_FILES := /cygdrive/c/Engine/lib/freetype/libfreetype.a
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/freetype/include
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := assimp
LOCAL_SRC_FILES := /cygdrive/c/Users/Jarek/Projects/NativeActivity/libs/assimp/libassimp.so
LOCAL_EXPORT_C_INCLUDES += /cygdrive/c/Users/Jarek/Projects/NativeActivity/libs/assimp/assimp
include $(PREBUILT_SHARED_LIBRARY)

##### The main game sources ####

include $(CLEAR_VARS)

LOCAL_PATH		:= $(BASE_PATH)

LOCAL_MODULE    := native-activity

LOCAL_SRC_FILES := \
	main.cpp \
    Game.cpp \
    MainMenu.cpp \
    StateManager.cpp \
    Util.cpp \
    
LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv1_CM -lGLESv2 -lz
LOCAL_STATIC_LIBRARIES := Engine-prebuilt android_native_app_glue png libfreetype
LOCAL_SHARED_LIBRARIES := assimp

include $(BUILD_SHARED_LIBRARY)
#include $(call all-subdir-makefiles)
$(call import-module,android/native_app_glue)
